HBase入门:shell模糊查询

您所在的位置:网站首页 shell tab 模糊 HBase入门:shell模糊查询

HBase入门:shell模糊查询

2024-07-13 07:25| 来源: 网络整理| 查看: 265

使用SingleColumnValueFilter 过滤数据时候,返回的数据不正常问题 

这是因为 忽略了SingleColumnValueFilter 的一个参数问题。

hbase 权威指南文档原文:

The filter class also exposes a few auxiliary methods you can use to fine tune its behavior: boolean getFilterIfMissing()void setFilterIfMissing(boolean filterIfMissing) boolean getLatestVersionOnly() void setLatestVersionOnly(boolean latestVersionOnly) The former controls what happens to rows that do not have the column at all. By default they are included in the result, but you can use setFilterIfMissing(true) to reverse that behavior, i.e., all rows that do not have the reference column are dropped from the result. 266 Note You must include the column you want to filter by, i.e., the reference column, into the families you query for - using addColumn() for example. If you fail to do so the column is considered missing and the result is either empty, or contains all rows, based on the getFilterIfMissing() result.

 设置SingleColumnValueFilter时候注意的地方: 要过滤的列必须存在,如果不存在,那么这些列不存在的数据也会返回。如果不想让这些数据返回,做如下设置即可。 filter.setFilterIfMissing(true); 

———————————————— 此处引用自:https://blog.csdn.net/maixia24/article/details/11768753



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3